<?php
/*
	监听会员登陆事件
	检查会员是否在分销插件中注册，如果尚未注册，此处注册！
*/
defined('BY_JYA') or exit('error');
$member=$this->get('member',array('mid'=>$_SESSION['uid']),array('mid'));
$myteam=$this->get('team',array('mid'=>$_SESSION['uid'],'uniacid'=>$_SESSION['uniacid']));
if(!$member['id']){
	$member=$this->model('member')->register();
}
$member=$this->get('team',array('mid'=>$_SESSION['uid']));
if(!$member['fromuser']){
	$fromuser=pdo_getcolumn('core_members',array('id'=>$_SESSION['uid']),'fromuser');
	$fromuser=$_SESSION['fromuser']?:$fromuser;
	if($fromuser){
		$this->model('member')->set_parent($_SESSION['uid'],$fromuser);
	}
}